<!--
 * @Descripttion: 表格组件
 * @version: 
 * @Author: Bruce
 * @Date: 2020-11-03 15:05:16
 * @LastEditors: Bruce
 * @LastEditTime: 2020-11-03 18:31:05
-->

<template>
	<el-table class="table" :data="tableData" style="width: 100%;" v-loading="loading">

		<el-table-column v-for="(item, idx) of tableTitle" :key="idx" :prop="item.prop" :label="item.label" :min-width="100" align="center">
		</el-table-column>

		<!-- 右侧操作区 -->
		<el-table-column v-if="$scopedSlots.action" fixed="right" label="操作" align="center">
			<template slot-scope="scope">
				<slot :row="scope.row" name="action"></slot>
			</template>
		</el-table-column>
	</el-table>
</template>

<script>
	export default {
		props: {
			tableTitle: {
				type: Array
			},
			tableData: {
				type: Array
			},
			loading: {
				type: Boolean
			}
		},
	}
</script>

<style lang="scss" scoped>
	// 去除底部边框样式
	.el-table::before {
		height: 0;
	}

	/deep/.el-table__fixed-right::before,
	.el-table__fixed::before {
		height: 0;
	}
</style>
